package com.fwmagic.spi;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description:
 * @author: fangw
 * @Date: 2023/2/6
 **/
@Configuration
@EnableConfigurationProperties(UserProperties.class)
public class UserServiceAutoConfiguration {
    static {
        System.out.println("UserServiceAutoConfiguration init……");
    }

    @Autowired
    private UserProperties userProperties;

    @Bean
    public UserService userService() {
        return new UserService(userProperties);
    }
}
